#include "linkqueue.h"

int main(int argc, char const *argv[])
{
    queue *q = init_queue();

    int n;
    while(1)
    {
        scanf("%d", &n);

        if(n > 0)
        {
            if (en_queue(q, new_node(n)))
                show(q);
            else
                printf("入队失败!\n");
        }
        else if(n < 0)
        {
            list m;
            if(out_queue(q, &m))
                show(q);
            else
                printf("出队失败!\n");
        }
        else
            break;
    }
    return 0;
}
